Including diagrams in your documents

DVIview can include draw files, sprites and JPEGs4in your TEX and LATEX documents. To include a diagram simply put the line
\special{DVIview_diagram filename}
at the point where you want the top-left of the diagram to appear. You can use the symbol `@' to represent the directory that the dvi file is in i.e.
\special{DVIview_diagram @.Diagrams.Picture}
in the file $.Report.dvi would include the file $.Report.Diagrams.Picture.

DVIview allows you to scale and crop your diagrams. To do so, simply add one or both of these commands after the file name in the special command above:

crop left right top bottom
This crops an amount from each edge of the diagram. The amounts are specified in draw units (there are 46080 draw units in an inch, 18142 in a centimetre) and may be negative in which case extra white space is added to the edge of the diagram.
scale x-scale y-scale
This scales the diagram in the x and y directions. The scales are numbers representing percentages.

For example:
\special{DVIview_diagram @.Picture scale 50 50}

Note that scaling is performed before cropping, so if you crop 2cm from the left-hand edge of a diagram scaled to 50%, it will remove 2cm from the diagram you see on screen rather than 1cm.

Also, for compatibility with TechWriter, a border of 512 draw units is placed around each diagram. You'll need to take this into account for precise cropping.

In DVIview.tex, there is a macro \diagram{width}{height}{filename [optional commands]} that will make space for and include a diagram in a LATEX document if you give it the size of the diagram. As an example see figure [*].

Figure: The author — A self portrait
\begin{figure}\begin{center}
\makebox[3cm][l]{\rule[-3.6cm]{0mm}{3.6cm}\special{DVIview_diagram @.Diagrams.Me-Honest! scale 75 75}}
\end{center}
\end{figure}

It would make life much easier if this macro could read the bounding box of the diagram. Unfortunately, I don't know if this is possible so if there are any wizards out there who can help me then please get in contact.



Subsections